package com.qf.service;

import com.qf.dao.UserDao;
import com.qf.pojo.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

/**
 * @author sunyamei
 * @version V1.0
 * @Project javase2203
 * @Package com.qf.service
 * @Description:
 * @Date 2022/8/8 19:21
 */
@Service
public class UserServiceImpl  implements  UserService{

   @Autowired
   private UserDao userDao;


    /**
     * 查询所有
     * @return
     */
    @Override
    public List<User> findAll() {
        List<User> list = userDao.findAll();
        return list;
    }


    /**
     * 根据ID查询
     * @param id
     * @return
     */
    @Override
    public User findById(Integer id) {
        User user = userDao.findById(id);
        return user;
    }


    /**
     * 添加
     * @param user
     */
    @Override
    public void add(User user) {

        userDao.add(user);
    }
}
